package au.edu.uq.itee.engg2800.team19;

import gnu.io.SerialPort;
public enum FlowControl {
	 FLOWCONTROL_NONE(SerialPort.FLOWCONTROL_NONE,"None"),
	 FLOWCONTROL_RTSCTS_IN(SerialPort.FLOWCONTROL_RTSCTS_IN,"RTS/CTS IN"),
	 FLOWCONTROL_RTSCTS_OUT(SerialPort.FLOWCONTROL_RTSCTS_OUT,"RTS/CTS OUT"),
	 FLOWCONTROL_XONXOFF_IN(SerialPort.FLOWCONTROL_XONXOFF_IN,"XON/XOFF IN"),
	 FLOWCONTROL_XONXOFF_OUT(SerialPort.FLOWCONTROL_XONXOFF_OUT,"XON/XOFF OUT");

	 private int code;
	 private String displayName;
	 private FlowControl(int c,String displayName) {
	   code = c;
	   this.displayName=displayName;
	 }

	 public int getCode() {
	   return code;
	 }

	static String[] enumsToStringArray() {
		   String[] results = new String[FlowControl.values().length];
	        int count = 0;
	        for (FlowControl each  : FlowControl.values()) {
	            results[count] = each.toString();
	            count++;
	        }
	        return results;
	}
	@Override
	public String toString(){
	     return displayName;
	}
}